# -*-coding:utf-8-*-
# Created by ccp on 2018/4/27.
import sys


# 自定义异常错误
class CustomError(ValueError):
    ERROR = ("-1", "没有该用户！")


# 抛出异常测试函数
def raiseTest(err):
    # 抛出异常
    raise CustomError(CustomError.ERROR[0],  # 异常错误参数1
                      CustomError.ERROR[1])  # 异常错误参数2


def main():
    try:
        print("*******************Start of Main********")
        if len(sys.argv) == 1:
            raiseTest()
        print("*****************End of Main")
    except CustomError as msg:
        print("errCode:", msg.args[0])
        print("errMsg:", msg.args[1])


if __name__ == '__main__':
    main()
